package com.sztz.mapstruct.H自定义映射方法;

import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
 * CarMapper
 *
 * @author yyf
 * @email yeyafei@hotmail.com
 */
@Mapper(uses = DateMapper.class)
public interface CarMapper {

    CarMapper INSTANCE = Mappers.getMapper(CarMapper.class);

    /**
     * DateMapper 格式化Date
     *
     * @param car
     * @return CarDTO
     */
    CarDTO toDto(Car car);

    /**
     * 自定义转换
     *
     * @param user
     * @return CarDTO
     */
    default CarDTO toDto2(Car user) {
        CarDTO dto = new CarDTO();
        dto.setName(user.getName() + "可以的！");
        return dto;
    }

}
